package models

import (
	"github.com/google/uuid"
	"gorm.io/gorm"
)

type OddRules struct {
	Id        string  `gorm:"primaryKey; type:varchar(255);comment:主键" json:"id"`
	BetType   string  `gorm:"type:varchar(50);not null; comment:分类类型" json:"betType"`
	OddsName  string  `gorm:"type:varchar(50);;not null; comment:下注类型" json:"oddsName"`
	OddsValue float64 `gorm:"type:decimal(10,2);not null;comment:赔率" json:"oddsValue"`
	IsActive  int     `gorm:"type:bool;not null;comment:是否启用" json:"isActive"`
	Sort      int     `gorm:"type:int;not null;comment:排序;default:0" json:"sort"`
}

func (odd_rules *OddRules) TableName() string {
	return "odd_rules"
}

func (odd_rules *OddRules) BeforeCreate(tx *gorm.DB) (err error) {
	odd_rules.Id = uuid.NewString()
	return
}
